package servlet.admin;

import service.BlogService;
import service.Impl.BlogServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/admin/BlogDelete")
public class BlogDeleteServlet extends HttpServlet {
    private BlogService blogService = new BlogServiceImpl();

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        int id = Integer.parseInt(req.getParameter("id"));
        blogService.delete(id);
//        resp.sendRedirect(req.getContextPath()+"/admin/BlogListService");
    }
}
